package webRespones

import (
	"C_ProblemWorkOrder/model"
	"C_ProblemWorkOrder/users"

	//"C_ProblemWorkOrder/webRespones"
	//"github.com/cht9862/mango/myloger"
	"github.com/gin-gonic/gin"
)

//var logFmt = myloger.NewLog()
var M = model.MysqlOrm{}
var U = users.User{}


func CheckUser() gin.HandlerFunc {
	return func(c *gin.Context) {
		U.Name = c.PostForm("username")
		U.Passwd = c.PostForm("password")
		err := M.GetUser(U.Name,U.Passwd)
		if err != nil {
			c.JSON(420,gin.H{
				"requestStatus": 420,
				"describe": "验证不通过",
			})
		} else {
			c.JSON(200,gin.H{
				"requestStatus": 200,
				"describe": "验证通过",
			})
		}
	}
}